@extends('http.app')

@section('content')
    <div class="content">
        <div class="wenzhang">
            <div class="positionbg"><span>您当前所在位置：<a href="/">首页</a> &gt;
                    <span class="search-keywords" style="color:#c00;">{{$keywords}}</span>&nbsp;结果</span>
            </div>
            <div class="ss_container">
                <div class="left ssy_leftbar">
                    <div class="searchType-title">搜索范围</div>
                    <div class="searchType-column">
                        <ul>
                            @foreach($categories as $val)
                                <li>
                                    <a href="/s?keywords={{$keywords}}&cat_id={{$val['cat_id']}}&type={{$type}}&sort={{$sort}}" @if($val['cat_id'] == $cat_id)class="active" @endif target="_self">
                                        {{$val['title']}}
                                    </a>
                                </li>
                            @endforeach
                        </ul>
                    </div>
                    <div class="fenlei_tit">时间范围</div>
                    <div class="total_wz">
                        <ul>
                            <li class="class-title">
                                <a href="/s?keywords={{$keywords}}&cat_id={{$cat_id}}&type=0&sort={{$sort}}" @if($type == 0)class="active" @endif target="_self">全部</a>
                            </li>
                            <li>
                                <a href="/s?keywords={{$keywords}}&cat_id={{$cat_id}}&type=1&sort={{$sort}}" @if($type == 1)class="active" @endif target="_self">一天内</a>
                            </li>
                            <li>
                                <a href="/s?keywords={{$keywords}}&cat_id={{$cat_id}}&type=3&sort={{$sort}}" @if($type == 3)class="active" @endif target="_self">一周内</a>
                            </li>
                            <li>
                                <a href="/s?keywords={{$keywords}}&cat_id={{$cat_id}}&type=6&sort={{$sort}}" @if($type == 6)class="active" @endif target="_self">一月内</a>
                            </li>
                            <li>
                                <a href="/s?keywords={{$keywords}}&cat_id={{$cat_id}}&type=11&sort={{$sort}}" @if($type == 11)class="active" @endif target="_self">一年内</a>
                            </li>
                        </ul>
                    </div>
                    <div class="fenlei_tit">排序方式</div>
                    <div class="total_wz">
                        <ul>
                            <li>
                                <a href="/s?keywords={{$keywords}}&cat_id={{$cat_id}}&type={{$type}}&sort=1" @if($sort == 1)class="active" @endif target="_self">按时间升序</a>
                            </li>
                            <li>
                                <a href="/s?keywords={{$keywords}}&cat_id={{$cat_id}}&type={{$type}}&sort=2" @if($sort == 2)class="active" @endif target="_self">按时间降序</a>
                            </li>
                        </ul>
                    </div>
                </div>
                <div class="right ssy_rightbar">

                    @if($informations['data'])
                        @foreach($informations['data'] as $val)
                            <ul class="search-list">
                                <li class="search-title">
                                    <a href="/d/{{$val['id']}}" target="_blank" title="{{$val['title']}}">
                                        {{$val['title']}}
                                    </a>
                                </li>
                                <li class="search-info">
                                    {{$val['summary']}}
                                </li>
                                <li class="search-column">
                                    所在栏目：{{$val['cat_name']}}
                                </li>
                                <li class="search-url">
                                    <a href="{{$_SERVER['HTTP_HOST']}}/d/{{$val['id']}}" target="_blank">
                                        http://{{$_SERVER['HTTP_HOST']}}/d/{{$val['id']}}
                                    </a>
                                    <span class="date">{{date('Y-m-d', strtotime($val['created_at']))}}</span>
                                </li>
                            </ul>
                        @endforeach

                        <div id="page_16513871" class="pagination"></div>
                        <script>
                            Ls.pagination("#page_16513871", function(page) {
                                location.href = '/s?keywords={{$keywords}}&cat_id={{$cat_id}}&type={{$type}}&sort={{$sort}}&page=' + page;
                            }, {
                                isTotal: true,
                                total: {{$informations['total']}},
                                currPage: {{$informations['current_page']}},
                                pageCount: {{$informations['last_page']}},
                                param: "limit=18"
                            });
                        </script>
                    @else
                        <div class="warm-prompt">
                            很抱歉，没有找到和您的查询相匹配的结果。<br>
                            您可以尝试更换检索词，重新检索。
                        </div>
                    @endif

                    <div class="clear"></div>
                </div>
                <div class="clear"></div>
            </div>
        </div>
        <div class="clear20"></div>
    </div>
@endsection